<?php
class Cadastromodel extends CI_Model
{
  
      function __construct()
    {
        parent::__construct();
    }
  
  function getDisplayableByUsername($nome)
  {
    //indica os campos
    $this->db->select('nome, email');
    $result = $this->db->get_where(
     'usuario',
     array('nome' => $username));
    return $result->row();
  }

  function getAllDisplayable()
  {
    $this->db->select('nome, email');
    $result = $this->db->get('usuario');
    return $result->result();
  }
  
  function register()
  {
	$data['username'] = $this->input->post('username');
	$data['passwd'] = $this->input->post('passwd');
	$data['email'] = $this->input->post('email');

$this->db->insert('usuario', $data);
}
}